LIBPOKER=libpoker@A@

MKTABLE_HELPERS = mktable@O@ mktable_utils@O@

OBJ=$(DERIVED_SOURCES:.c=@O@) \
	deck@O@ deck_std@O@ rules_std@O@ rules_joker@O@ evx@O@ \
	deck_astud@O@ rules_astud@O@ deck_joker@O@ lowball@O@ \
	md5c@O@ 

BASIC_TABLES = \
	t_nbits.c t_topbit.c t_topcard.c t_topfivecards.c t_topfivebits.c \
        t_toptwobits.c t_cardmasks.c t_maskrank.c t_straight.c 
PACKED_TABLES = \
	t_nbitsandstr.c
EVX_TABLES = \
	t_evx_pairval.c t_evx_strval.c t_evx_tripsval.c t_evx_flushcards.c
ASTUD_TABLES = t_astudcardmasks.c
JOKER_TABLES = t_jokercardmasks.c t_jokerstraight.c
LOWBALL_TABLES = t_botfivecards.c t_botcard.c t_botfivecardsj.c

EVX_HEADERS = ../include/inlines/evx5.h ../include/inlines/evx7.h

PROGRAMS = mktab_basic@E@ mktab_packed@E@ mktab_evx@E@ mktab_astud@E@ \
	mktab_joker@E@ mktab_lowball@E@ \
	evx_gen5@E@ evx_gen7@E@

DERIVED_SOURCES = \
	$(BASIC_TABLES) \
	$(PACKED_TABLES) \
	$(EVX_TABLES) \
	$(ASTUD_TABLES) \
	$(JOKER_TABLES) \
	$(LOWBALL_TABLES) 

CC = @CC@ 
CFLAGS = @CFLAGS@ 
RANLIB = @RANLIB@ 
AR = ar
RM = @RM@
CC_OBJ = $(CC) $(CFLAGS) -I../include @CC_OBJ@
CC_EXE = $(CC) $(CFLAGS) -I../include @CC_EXE@
RUN_IT = @RUN_IT@
LIB_CMD = @LIB_CMD@

all:	$(LIBPOKER) $(EVX_HEADERS)

$(LIBPOKER): $(OBJ)
	$(LIB_CMD)
	$(RANLIB) $@

clean:
	$(RM) *@O@ core $(OBJ) $(LIBPOKER) $(DERIVED_SOURCES) $(PROGRAMS) 

$(BASIC_TABLES): mktab_basic@E@
	$(RUN_IT)

$(PACKED_TABLES): mktab_packed@E@
	$(RUN_IT)

$(EVX_TABLES): mktab_evx@E@
	$(RUN_IT)

$(ASTUD_TABLES): mktab_astud@E@
	$(RUN_IT)

$(JOKER_TABLES): mktab_joker@E@
	$(RUN_IT)

$(LOWBALL_TABLES): mktab_lowball@E@
	$(RUN_IT)

../include/inlines/evx5.h:	evx_gen5@E@
	$(RUN_IT) >  $@

../include/inlines/evx7.h:	evx_gen7@E@
	$(RUN_IT) >  $@


mktab_basic@E@: mktab_basic@O@ $(MKTABLE_HELPERS)
	$(CC_EXE) 

mktab_packed@E@: mktab_packed@O@ $(MKTABLE_HELPERS)
	$(CC_EXE) 

mktab_evx@E@: mktab_evx@O@ $(MKTABLE_HELPERS)
	$(CC_EXE) 

mktab_astud@E@: mktab_astud@O@ $(MKTABLE_HELPERS)
	$(CC_EXE) 

mktab_joker@E@: mktab_joker@O@ $(MKTABLE_HELPERS)
	$(CC_EXE) 

mktab_lowball@E@: mktab_lowball@O@ $(MKTABLE_HELPERS)
	$(CC_EXE) 

evx_gen5@E@:	evx_gen5@O@
	$(CC_EXE)

evx_gen7@E@:	evx_gen7@O@
	$(CC_EXE)

.c@O@:
	$(CC) $(CFLAGS) -I../include -c $<

evx_gen5@O@:	evx_generate.c
	$(CC_OBJ) -DCARDS_DEALT=5 

evx_gen7@O@:	evx_generate.c
	$(CC_OBJ) -DCARDS_DEALT=7 

